#include "astrology.c"
#define SIZE 256

/*
int
main(void) {
    char buffer[SIZE];
    time_t curtime;
    struct tm *loctime;

    char *mnth;
    int day;

    // Get the current time. 
    curtime = time(NULL);

    // Convert it to local time representation.  
    loctime = localtime(&curtime);

    // Getting Month
    strftime(buffer, SIZE, "%B", loctime);
    mnth = buffer;
    printf("\nThe Month is: %s\n", mnth);


    // Getting Day
    strftime(buffer, SIZE, "%d", loctime);
    day = atoi(buffer);
    printf("\nThe Day is: %d\n", day);

    return 0;
}

 */
char getMonthByDate() {

    // Getting Month
    char buffer[SIZE];
    time_t curtime;
    struct tm *loctime;

    char *mnth;
    int day;

    /* Get the current time.  */
    curtime = time(NULL);

    /* Convert it to local time representation.  */
    loctime = localtime(&curtime);

    // Getting Month
    strftime(buffer, SIZE, "%B", loctime);
    //strftime(buffer, SIZE, "%c", loctime);// Current Time
    //mnth = atoi(buffer); -> Uncomment this portion when Application is Behaving Funny
    by_month(buffer);
    //return atoi(buffer);
    //printf("%s",buffer);
    //return *buffer; // Put this return type into Array
}

int getDayByDate() {
    char buffer[SIZE];
    time_t curtime;
    struct tm *loctime;

    char *mnth;
    int day;

    /* Get the current time.  */
    curtime = time(NULL);

    /* Convert it to local time representation.  */
    loctime = localtime(&curtime);


    // Getting Day
    strftime(buffer, SIZE, "%d", loctime);
    day = atoi(buffer);
    return day;
}
/*
 Astrology Function
 Function to show sign by Date
 * parameters i Month and date
 
 */


void astrology(int month, int day) {

    switch (month) {
        case 01:
            if (day >= 01 && day <= 19) {
                capricorn();
            } else if (day >= 20 && day >= 31) {
                aquarius();
            } else {
                printf("Invalid Date");
            }
        case 02:
            if (day >= 01 && day <= 18) {
                aquarius();
            } else if (day >= 19 && day <= 29) {
                pisces();
            } else {
                printf("Invalid Date");
            }
            break;
        case 03:
            if (day >= 01 && day <= 20) {
                pisces();
            } else if (day >= 21 && day <= 31) {
                aries();
            } else {
                printf("Invalid Dates");
            }
            break;

        case 04:
            if (day >= 01 && day <= 19) {
                aries();
            } else if (day >= 20 && day <= 30) {
                taurus();
            } else {
                printf("Invalid Date");
            }
            break;
        case 05:
            if (day >= 01 && day <= 20) {
                taurus();
            } else if (day >= 21 && day <= 31) {
                gemini();
            } else {
                printf("Invalid Date");
            }
            break;

        case 06:
            if (day >= 01 && day <= 20) {
                gemini();
            } else if (day >= 21 && day <= 30) {
                cancer();
            } else {
                printf("Invalid Date");
            }
            break;
        case 07:
            if (day >= 01 && day <= 22) {
                cancer();
            } else if (day >= 23 && day <= 31) {
                leo();
            } else {
                printf("Invalid Date");
            }
            break;

        case 8:
            if (day >= 01 && day <= 22) {
                leo();
            } else if (day >= 23 && day <= 31) {
                virgo();
            } else {
                printf("Invalid Date");
            }


            break;
        case 9:
            if (day >= 01 && day <= 22) {
                virgo();
            } else if (day >= 23 && day <= 30) {
                libra();
            } else {
                printf("Invalid Date");
            }
            break;

        case 10:
            if (day >= 01 && day <= 22) {
                libra();
            } else if (day >= 23 && day <= 31) {
                scorpio();
            } else {
                printf("Invalid Date");
            }
            break;
        case 11:
            if (day >= 01 && day <= 21) {
                scorpio();
            } else if (day >= 22 && day <= 30) {
                sagittarius();
            } else {
                printf("Invalid date");
            }
            break;

        case 12:
            if (day >= 01 && day <= 21) {
                sagittarius();
            } else if (day >= 22 && day <= 31) {
                capricorn();
            } else {
                printf("Invalid Date");
            }
        case 0:

            break;

        default:

            break;


    }

}


/*Function to get Date and Month
 
 */
void getDayAndMonth(){
    
    char Tbuffer[SIZE];
    char buffer[SIZE];
    time_t curtime;
    struct tm *loctime;

    char *mnth;
    int day;

    /* Get the current time.  */
    curtime = time(NULL);

    /* Convert it to local time representation.  */
    loctime = localtime(&curtime);


    // Getting Day
    strftime(Tbuffer, SIZE, "%d", loctime);
    day = atoi(Tbuffer);
    //return day;

    /* Get the current time.  */
    curtime = time(NULL);

    /* Convert it to local time representation.  */
    loctime = localtime(&curtime);

    // Getting Month
    strftime(buffer, SIZE, "%B", loctime);
    astrology(monthsToday(buffer), day);// Calling the Moth Today Function
}

// End of Function